<template>
  <div class="run-qian-report w-full h-full no-scroll">
    <iframe v-if="url" :src="url" class="run-qian-report-frame"></iframe>
  </div>
</template>

<script>
import projectService from '@/api/projectService'
export default {
  name: 'RunQianReport',
  props: {
    params: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data () {
    return {
      intranet: '',
      url: ''
    }
  },
  mounted () {
    this.intranet = window.config.VUE_APP_BASE_URL_INTRANET || window.config.VUE_APP_BASE_URL
    this.init()
  },
  methods: {
    async init () {
      const data = await projectService.getProjectReportUrl(this.params.projectId,
        this.params.revisionId, {})
      if (data.url) {
        this.url = data.url
      }
      // const url = `${this.intranet}report/wopi/show/${this.params.projectId}/${this.params.revisionId}/true`
      // this.url = url
    }
  }
}
</script>

<style scoped lang="less">
.run-qian-report{
  &-frame {
    width: 100%;
    height: 100%;
    border: none;
  }
}
</style>
